<!-- HTML header for doxygen 1.8.14-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="cache-control" content="max-age=86400"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GBDK 2020 Docs: gbdk-lib/include/gbdk/emu_debug.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">GBDK 2020 Docs
   &#160;<span id="projectnumber">4.4.0</span>
   </div>
   <div id="projectbrief">API Documentation for GBDK 2020</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('gbdk_2emu__debug_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">emu_debug.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gbdk_2emu__debug_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">// Suppress SDCC &quot;info 128&quot; warnings that are a non-issue</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#pragma disable_warning 218</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#ifndef __GBDK_EMU_DEBUG_H_INCLUDE</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define __GBDK_EMU_DEBUG_H_INCLUDE</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160; </div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &lt;types.h&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#if defined(__TARGET_gb) || defined(__TARGET_ap) || defined(__TARGET_sms) || defined(__TARGET_gg)</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a5624be3849bf5308c6cc05bc4a624557">   46</a></span>&#160;<span class="preprocessor">#define EMU_MESSAGE(message_text) EMU_MESSAGE1(EMU_MACRONAME(__LINE__), message_text)</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#aabd48c83af8f69ed624bb8a83347fa39">   47</a></span>&#160;<span class="preprocessor">#define BGB_MESSAGE(message_text) EMU_MESSAGE(message_text)</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#define EMU_MACRONAME(A) EMU_MACRONAME1(A)</span></div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#define EMU_MACRONAME1(A) EMULOG##A</span></div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="preprocessor">#define EMU_MESSAGE1(name, message_text) \</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">__asm \</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">.MACRO name msg_t, ?llbl \</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">  ld d, d \</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">  jr llbl \</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">  .dw 0x6464 \</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">  .dw 0x0000 \</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<span class="preprocessor">  .ascii msg_t \</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="preprocessor">llbl: \</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="preprocessor">.ENDM \</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="preprocessor">name ^/message_text/ \</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">__endasm</span></div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">#define EMU_MESSAGE_SUFFIX(message_text, message_suffix) EMU_MESSAGE3(EMU_MACRONAME(__LINE__), message_text, message_suffix)</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor">#define EMU_MESSAGE3(name, message_text, message_suffix) \</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor">__asm \</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">.MACRO name msg_t, msg_s, ?llbl \</span></div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor">  ld d, d \</span></div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">  jr llbl \</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor">  .dw 0x6464 \</span></div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">  .dw 0x0000 \</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">  .ascii msg_t \</span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor">  .ascii msg_s \</span></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">llbl: \</span></div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">.ENDM \</span></div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="preprocessor">name ^/message_text/, ^/message_suffix/ \</span></div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor">__endasm</span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a5359c3e6ddab89f41f1de770cc3640d4">   92</a></span>&#160;<span class="preprocessor">#define EMU_PROFILE_BEGIN(MSG) EMU_MESSAGE_SUFFIX(MSG, &quot;%ZEROCLKS%&quot;</span>);</div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#ab5b05deda52856c84f274fb28578b6ee">   93</a></span>&#160;<span class="preprocessor">#define BGB_PROFILE_BEGIN(MSG) EMU_PROFILE_BEGIN(MSG)</span></div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="preprocessor">#if defined(NINTENDO)</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#acce78126775a7ca3c862459e28203aba">  120</a></span>&#160;<span class="preprocessor">#define EMU_PROFILE_END(MSG) EMU_MESSAGE_SUFFIX(MSG,&quot;%-8+LASTCLKS%&quot;</span>);</div>
<div class="line"><a name="l00121"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#ab43f94064dc523e99c4aefb440e2c3ed">  121</a></span>&#160;<span class="preprocessor">#define BGB_PROFILE_END(MSG) EMU_PROFILE_END(MSG)</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;<span class="preprocessor">#elif defined(SEGA)</span></div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="preprocessor">#define EMU_PROFILE_END(MSG) EMU_MESSAGE_SUFFIX(MSG,&quot;%-16+LASTCLKS%&quot;</span>);</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;<span class="preprocessor">#define BGB_PROFILE_END(MSG) EMU_PROFILE_END(MSG)</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#ad1ca656789d7d285b352afeaa4cc56bd">  127</a></span>&#160;<span class="preprocessor">#define EMU_TEXT(MSG) EMU_MESSAGE(MSG)</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a6afa665bd7d093e7ca2d310cc92b08a9">  128</a></span>&#160;<span class="preprocessor">#define BGB_TEXT(MSG) EMU_TEXT(MSG)</span></div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160; </div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;<span class="preprocessor">#if defined(NINTENDO)</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#aa5de1bb0c5fd4fbb23019b4908cc9588">  139</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="gbdk_2emu__debug_8h.html#aa5de1bb0c5fd4fbb23019b4908cc9588">EMU_profiler_message</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#af36a13974260d50a3b602f5106f4b9e1">  140</a></span>&#160;<span class="preprocessor">#define BGB_profiler_message EMU_profiler_message()</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// NINTENDO</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160; </div>
<div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a4c2e4adef74067fdbb49005bc73de937">  173</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *format, ...) <a class="code" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(a, <a class="code" href="gbdk_2emu__debug_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>, <a class="code" href="gbdk_2emu__debug_8h.html#a0b3366755f3276b0243c1e0497471b7a">c</a>);</div>
<div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a892ddea0cd396141c1ae05e384303cbf">  174</a></span>&#160;<span class="preprocessor">#define BGB_printf(...) EMU_printf(__VA_ARGS__)</span></div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a322fb0f357e31e5f275d6c1b2c71d1e7">  185</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="gbdk_2emu__debug_8h.html#a322fb0f357e31e5f275d6c1b2c71d1e7">EMU_fmtbuf</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * format, <span class="keywordtype">void</span> * data) <a class="code" href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a>(a, <a class="code" href="gbdk_2emu__debug_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a>, <a class="code" href="gbdk_2emu__debug_8h.html#a0b3366755f3276b0243c1e0497471b7a">c</a>);</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="preprocessor">#ifdef NINTENDO</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> * __EMU_PROFILER_INIT = &amp;<a class="code" href="gbdk_2emu__debug_8h.html#aa5de1bb0c5fd4fbb23019b4908cc9588">EMU_profiler_message</a>;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// NINTENDO</span></div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a9e856b4691d63bb41c5148b9097bd2bb">  193</a></span>&#160;<span class="preprocessor">#define EMU_BREAKPOINT __asm__(&quot;ld b, b&quot;</span>);</div>
<div class="line"><a name="l00194"></a><span class="lineno"><a class="line" href="gbdk_2emu__debug_8h.html#a95c9ae3faadfe6f93a3cac87085b3481">  194</a></span>&#160;<span class="preprocessor">#define BGB_BREAKPOINT EMU_BREAKPOINT</span></div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160; </div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="preprocessor">#elif defined(__TARGET_duck)</span></div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="preprocessor">  #error Not implemented yet</span></div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;<span class="preprocessor">  #error Unrecognized port</span></div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="aasm_2types_8h_html_acb825e83a33fcc06482c59b4ab2cf961"><div class="ttname"><a href="asm_2types_8h.html#acb825e83a33fcc06482c59b4ab2cf961">PRESERVES_REGS</a></div><div class="ttdeci">#define PRESERVES_REGS(...)</div><div class="ttdef"><b>Definition:</b> types.h:32</div></div>
<div class="ttc" id="agbdk_2emu__debug_8h_html_a0b3366755f3276b0243c1e0497471b7a"><div class="ttname"><a href="gbdk_2emu__debug_8h.html#a0b3366755f3276b0243c1e0497471b7a">c</a></div><div class="ttdeci">void c</div><div class="ttdef"><b>Definition:</b> emu_debug.h:173</div></div>
<div class="ttc" id="agbdk_2emu__debug_8h_html_a322fb0f357e31e5f275d6c1b2c71d1e7"><div class="ttname"><a href="gbdk_2emu__debug_8h.html#a322fb0f357e31e5f275d6c1b2c71d1e7">EMU_fmtbuf</a></div><div class="ttdeci">void EMU_fmtbuf(const unsigned char *format, void *data) PRESERVES_REGS(a</div></div>
<div class="ttc" id="agbdk_2emu__debug_8h_html_a4c2e4adef74067fdbb49005bc73de937"><div class="ttname"><a href="gbdk_2emu__debug_8h.html#a4c2e4adef74067fdbb49005bc73de937">b</a></div><div class="ttdeci">void b</div><div class="ttdef"><b>Definition:</b> emu_debug.h:173</div></div>
<div class="ttc" id="agbdk_2emu__debug_8h_html_a910b2802e154473f2e10201f5722bc10"><div class="ttname"><a href="gbdk_2emu__debug_8h.html#a910b2802e154473f2e10201f5722bc10">EMU_printf</a></div><div class="ttdeci">void EMU_printf(const char *format,...) PRESERVES_REGS(a</div></div>
<div class="ttc" id="agbdk_2emu__debug_8h_html_aa5de1bb0c5fd4fbb23019b4908cc9588"><div class="ttname"><a href="gbdk_2emu__debug_8h.html#aa5de1bb0c5fd4fbb23019b4908cc9588">EMU_profiler_message</a></div><div class="ttdeci">void EMU_profiler_message(void)</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.14-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
</div>
</body>
</html>
